﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.OSGrupa"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class OSGrupaEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the ID property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxID;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the ID property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDLabel;
		
		/// <summary>
		/// TextBox for the Oznaka property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxOznaka;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Oznaka property.
		/// </summary>
		protected System.Windows.Forms.Label uxOznakaLabel;
		
		/// <summary>
		/// TextBox for the Naziv property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxNaziv;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Naziv property.
		/// </summary>
		protected System.Windows.Forms.Label uxNazivLabel;
		
		/// <summary>
		/// ComboBox for the IDKontoNabavka property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDKontoNabavka;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDKontoNabavka property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDKontoNabavkaLabel;
		
		/// <summary>
		/// ComboBox for the IDKontoIspravka property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDKontoIspravka;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDKontoIspravka property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDKontoIspravkaLabel;
		
		/// <summary>
		/// ComboBox for the IDKontoTroska property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDKontoTroska;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDKontoTroska property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDKontoTroskaLabel;
		
		/// <summary>
		/// TextBox for the RedBr property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxRedBr;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the RedBr property.
		/// </summary>
		protected System.Windows.Forms.Label uxRedBrLabel;
		#endregion
		
		#region Main entity
		private Entities.OSGrupa _OSGrupa;
		/// <summary>
		/// Gets or sets the <see cref="Entities.OSGrupa"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.OSGrupa"/> instance.</value>
		public Entities.OSGrupa OSGrupa
		{
			get {return this._OSGrupa;}
			set
			{
				this._OSGrupa = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxID.DataBindings.Clear();
			this.uxID.DataBindings.Add("Text", this.uxBindingSource, "ID", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxOznaka.DataBindings.Clear();
			this.uxOznaka.DataBindings.Add("Text", this.uxBindingSource, "Oznaka", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxNaziv.DataBindings.Clear();
			this.uxNaziv.DataBindings.Add("Text", this.uxBindingSource, "Naziv", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDKontoNabavka.DataBindings.Clear();
			this.uxIDKontoNabavka.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDKontoNabavka", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDKontoIspravka.DataBindings.Clear();
			this.uxIDKontoIspravka.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDKontoIspravka", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDKontoTroska.DataBindings.Clear();
			this.uxIDKontoTroska.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDKontoTroska", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxRedBr.DataBindings.Clear();
			this.uxRedBr.DataBindings.Add("Text", this.uxBindingSource, "RedBr", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="OSGrupaEditControlBase"/> class.
		/// </summary>
		public OSGrupaEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_OSGrupa != null) _OSGrupa.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxID = new System.Windows.Forms.TextBox();
			uxIDLabel = new System.Windows.Forms.Label();
			this.uxOznaka = new System.Windows.Forms.TextBox();
			uxOznakaLabel = new System.Windows.Forms.Label();
			this.uxNaziv = new System.Windows.Forms.TextBox();
			uxNazivLabel = new System.Windows.Forms.Label();
			this.uxIDKontoNabavka = new System.Windows.Forms.ComboBox();
			uxIDKontoNabavkaLabel = new System.Windows.Forms.Label();
			this.uxIDKontoIspravka = new System.Windows.Forms.ComboBox();
			uxIDKontoIspravkaLabel = new System.Windows.Forms.Label();
			this.uxIDKontoTroska = new System.Windows.Forms.ComboBox();
			uxIDKontoTroskaLabel = new System.Windows.Forms.Label();
			this.uxRedBr = new System.Windows.Forms.TextBox();
			uxRedBrLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIDLabel
			//
			this.uxIDLabel.Text = "ID:";
			this.uxIDLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIDLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDLabel);			
			//
			// uxID
			//
			this.uxID.ReadOnly = true;
			//this.uxTableLayoutPanel.Controls.Add(this.uxID);
			this.uxID.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxID);
			//
			// uxOznakaLabel
			//
			this.uxOznakaLabel.Text = "Oznaka:";
			this.uxOznakaLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxOznakaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxOznakaLabel);			
			//
			// uxOznaka
			//
			this.uxOznaka.Width = 250;
			this.uxOznaka.MaxLength = 10;
			//this.uxTableLayoutPanel.Controls.Add(this.uxOznaka);
			this.uxOznaka.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxOznaka);
			//
			// uxNazivLabel
			//
			this.uxNazivLabel.Text = "Naziv:";
			this.uxNazivLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxNazivLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxNazivLabel);			
			//
			// uxNaziv
			//
			this.uxNaziv.Width = 250;
			this.uxNaziv.MaxLength = 50;
			//this.uxTableLayoutPanel.Controls.Add(this.uxNaziv);
			this.uxNaziv.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxNaziv);
			//
			// uxIDKontoNabavkaLabel
			//
			this.uxIDKontoNabavkaLabel.Text = "IDKontoNabavka:";
			this.uxIDKontoNabavkaLabel.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxIDKontoNabavkaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDKontoNabavkaLabel);			
			//
			// uxIDKontoNabavka
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDKontoNabavka);
			this.uxIDKontoNabavka.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxIDKontoNabavka);
			//
			// uxIDKontoIspravkaLabel
			//
			this.uxIDKontoIspravkaLabel.Text = "IDKontoIspravka:";
			this.uxIDKontoIspravkaLabel.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxIDKontoIspravkaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDKontoIspravkaLabel);			
			//
			// uxIDKontoIspravka
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDKontoIspravka);
			this.uxIDKontoIspravka.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxIDKontoIspravka);
			//
			// uxIDKontoTroskaLabel
			//
			this.uxIDKontoTroskaLabel.Text = "IDKontoTroska:";
			this.uxIDKontoTroskaLabel.Location = new System.Drawing.Point(3, 130);
			this.Controls.Add(this.uxIDKontoTroskaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDKontoTroskaLabel);			
			//
			// uxIDKontoTroska
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDKontoTroska);
			this.uxIDKontoTroska.Location = new System.Drawing.Point(160, 130);
			this.Controls.Add(this.uxIDKontoTroska);
			//
			// uxRedBrLabel
			//
			this.uxRedBrLabel.Text = "RedBr:";
			this.uxRedBrLabel.Location = new System.Drawing.Point(3, 156);
			this.Controls.Add(this.uxRedBrLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxRedBrLabel);			
			//
			// uxRedBr
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxRedBr);
			this.uxRedBr.Location = new System.Drawing.Point(160, 156);
			this.Controls.Add(this.uxRedBr);
			//
			// uxIDKontoNabavka
			//				
			this.uxIDKontoNabavka.DisplayMember = "Sifra";	
			this.uxIDKontoNabavka.ValueMember = "ID";	
			//
			// uxIDKontoIspravka
			//				
			this.uxIDKontoIspravka.DisplayMember = "Sifra";	
			this.uxIDKontoIspravka.ValueMember = "ID";	
			//
			// uxIDKontoTroska
			//				
			this.uxIDKontoTroska.DisplayMember = "Sifra";	
			this.uxIDKontoTroska.ValueMember = "ID";	
			// 
			// OSGrupaEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "OSGrupaEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
				
		private Entities.TList<Entities.Konto> _IDKontoNabavkaList;
		
		/// <summary>
		/// The ComboBox associated with the IDKontoNabavka property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.Konto> IDKontoNabavkaList
		{
			get {return _IDKontoNabavkaList;}
			set 
			{
				this._IDKontoNabavkaList = value;
				this.uxIDKontoNabavka.DataSource = null;
				this.uxIDKontoNabavka.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDKontoNabavkaList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDKontoNabavka property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDKontoNabavkaList
		{
			get { return _allowNewItemInIDKontoNabavkaList;}
			set
			{
				this._allowNewItemInIDKontoNabavkaList = value;
				this.uxIDKontoNabavka.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
				
		private Entities.TList<Entities.Konto> _IDKontoIspravkaList;
		
		/// <summary>
		/// The ComboBox associated with the IDKontoIspravka property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.Konto> IDKontoIspravkaList
		{
			get {return _IDKontoIspravkaList;}
			set 
			{
				this._IDKontoIspravkaList = value;
				this.uxIDKontoIspravka.DataSource = null;
				this.uxIDKontoIspravka.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDKontoIspravkaList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDKontoIspravka property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDKontoIspravkaList
		{
			get { return _allowNewItemInIDKontoIspravkaList;}
			set
			{
				this._allowNewItemInIDKontoIspravkaList = value;
				this.uxIDKontoIspravka.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
				
		private Entities.TList<Entities.Konto> _IDKontoTroskaList;
		
		/// <summary>
		/// The ComboBox associated with the IDKontoTroska property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.Konto> IDKontoTroskaList
		{
			get {return _IDKontoTroskaList;}
			set 
			{
				this._IDKontoTroskaList = value;
				this.uxIDKontoTroska.DataSource = null;
				this.uxIDKontoTroska.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDKontoTroskaList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDKontoTroska property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDKontoTroskaList
		{
			get { return _allowNewItemInIDKontoTroskaList;}
			set
			{
				this._allowNewItemInIDKontoTroskaList = value;
				this.uxIDKontoTroska.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
